package main

import (
	"context"
	"fmt"
	"go.uber.org/zap"
	"google.golang.org/grpc"
	"mxshop_srvs/goods_srv/proto"
	"mxshop_srvs/goods_srv/tests"
)

/*
	func TestGetCategoryList() {
		rsp, err := tests.Client.GetAllCategorysList(context.Background(), &emptypb.Empty{})
		if err != nil {
			panic(err)
		}
		fmt.Println(rsp.Total)
		fmt.Println(rsp.JsonData)
	}
*/
func TestGetSubCategoryList() {
	rsp, err := tests.Client.GetSubCategory(context.Background(), &proto.CategoryListRequest{
		Id: 1,
	})
	if err != nil {
		panic(err)
	}
	fmt.Println(rsp.SubCategorys)
}
func main() {
	tests.Init()
	TestGetSubCategoryList()
	defer func(Conn *grpc.ClientConn) {
		err := Conn.Close()
		if err != nil {
			zap.S().Errorf("conn.close错误")
		}
	}(tests.Conn)
}
